package com.yzc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.yzc.mapper.TourMapper;
import com.yzc.model.entity.system.Tour;
import com.yzc.service.TourService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


/**
 * @author Yzc
 * @description 针对表【t_tour】的数据库操作Service实现
 * @createDate 2024-06-13 15:28:57
 */
@Service
public class TourServiceImpl extends ServiceImpl<TourMapper, Tour>
        implements TourService {

    @Autowired
    private TourMapper tourMapper;


    @Override
    public List<Tour> selectInfos(Tour tourname) {
        QueryWrapper<Tour> queryWrapper = new QueryWrapper<>();
        if (tourname != null && tourname.getTourname() != null) {
            String likeValue = "%" + tourname.getTourname() + "%";
            queryWrapper.like("tourname", likeValue);
        }
        return tourMapper.selectList(queryWrapper);
    }

    @Override
    public void deleteInfos(int tourid) {
        tourMapper.deleteById(tourid);
        tourMapper.updatePveList();
    }

    @Override
    public Tour getTourid(Integer tourid) {
        return tourMapper.selectById(tourid);
    }

    @Override
    public List<Tour> loadAllTourData() {
        return tourMapper.loadAllTourData();
    }

    @Override
    public String delProductUrl(Integer productId, String url, String urls) {
        return "";
    }


}




